package com.nkzy.config;

import com.nkzy.filter.SecondFilter;
import org.springframework.boot.web.servlet.FilterRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * Create by 王建烨 on 2022/4/2 8:15
 **/

@Configuration
public class FilterConfig {
    // 完成 Filter 组件的注册
    @Bean
    public FilterRegistrationBean getFilter() {
        FilterRegistrationBean bean = new FilterRegistrationBean(new SecondFilter());
        bean.addUrlPatterns(new String[]{"/secondServlet"});
        return bean;
    }
}
